Insert Space after finding an OLE Object

Does anyone know if it's possible to have a script search through a module and find OLE Objects and when it does insert a hard return after it?

I have had nothing but trouble when it comes to OLE Objects and DXL coding so im just wondering if someone knows anything about this


MrNiceGuy - Fri Mar 31 14:01:30 EDT 2017

Re: Insert Space after finding an OLE Object
Mathias Mamsch - Fri Mar 31 15:55:36 EDT 2017

You can do so by parsing the richtext. There are some examples on the forum - one pretty generic parsing library (search for 'rtf parser mathias') and the other one is a library that allows you to compare OLE Objects (search for 'giveaway of the day mathias'). Maybe this will give you a starter. All you need to do is, 

a) find the RTF Ole Object Tag (\object)

b) search for the end of the \object tag (count {} braces)

c) insert a {\\par} at this point

d) Repeat until end of RTF ... You should be fine. Regards, Mathias
 

Re: Insert Space after finding an OLE Object
MrNiceGuy - Fri Mar 31 16:27:50 EDT 2017

Would it be easier if instead of searching for OLE Objects I search for <<Figure>> string and then put a hard return before it?

Re: Insert Space after finding an OLE Object
Mathias Mamsch - Sun Apr 02 10:37:39 EDT 2017

MrNiceGuy - Fri Mar 31 16:27:50 EDT 2017

Would it be easier if instead of searching for OLE Objects I search for <<Figure>> string and then put a hard return before it?

Not really ... You will have to search the RTF in any case, if you do it from DXL. When you do it manually though, you would probably be better of, searching for <<Figure>>. Regards, Mathias